package Thread;

public class MyRunnable implements Runnable {
    @Override
    public void run() {
        int i = 0;
        while(i<10){
            System.out.println(Thread.currentThread().getName()+"线程在运行，给i+1");
            i++;
        }
    }
}

class Test{
    public static void main(String[] args) {
        MyRunnable myRunnable = new MyRunnable();
        Thread t1 = new Thread(myRunnable);
        Thread t2 = new Thread(myRunnable);
        t1.start();
        t2.start();
    }
}